﻿namespace CN2P.ServiceModel
{
    using System.Runtime.Serialization;

    [DataContract]
    public class RecommendationItemModel
    {

        public RecommendationItemModel()
        {
        }

        public RecommendationItemModel(string fromId, string toId)
        {
            FromProdId = fromId;
            ToProdId = toId;
        }

        [DataMember(Name = "from")]
        public string FromProdId { get; set; }

        [DataMember(Name = "to")]
        public string ToProdId { get; set; }

        public bool HasProduct(string productId)
        {
            return this.FromProdId == productId || this.ToProdId == productId;
        }

        public string[] GetProducts()
        {
            return new[] { FromProdId, ToProdId };
        }
    }
}
